﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LisaCore
{
    /// <summary>
    /// This is the interface for a PriorityQueue. A priority Queue stores objects in a queue. However, objects
    /// with higher priorities are at the font of the queue. Objects with equal priorities are dealt with in a
    /// first-in first-out manner (ie: like in a normal queue).
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public interface IPriorityQueue<T>
    {
        /// <summary>
        /// Enqueues an object with the given priority in the priority queue. Items with a higher priority are
        /// inserted farther towards the front of the queue (meaning they'll be dequeued sooner).
        /// </summary>
        /// <param name="item">The item to be enqueued.</param>
        /// <param name="priority">The priority of the item.</param>
        void Enqueue(T item, int priority);

        /// <summary>
        /// Returns and removes the element at the front of the queue.
        /// </summary>
        /// <returns>The element at the front of the queue.</returns>
        T Dequeue();

        /// <summary>
        /// Returns the highest priority in the queue.
        /// </summary>
        /// <returns>The highest priority in the priority queue.</returns>
        int getHighestPriority();

        /// <summary>
        /// Returns the number of elements in the queue.
        /// </summary>
        /// <returns>The number of elements in the queue.</returns>
        int size();

        /// <summary>
        /// Returns true if the queue is empty, false otherwise.
        /// </summary>
        /// <returns>True if the queue is empty, false otherwise.</returns>
        bool isEmpty();

        /// <summary>
        /// Clears the queue.
        /// </summary>
        void clear();
    }
}
